/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.view;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.component.PayImgTextView;
import com.qihoo.gamecenter.sdk.pay.component.PayResponseContent;

public class b extends com.qihoo.gamecenter.sdk.pay.component.a {
    private PayImgTextView f;
    private View g;
    private PayResponseContent h;
    private LinearLayout i;
    private String j = "";

    public b(Activity paramActivity, Intent paramIntent, String paramString) {
        super(paramActivity, paramIntent);
        this.j = paramString;
    }

    protected View b(int paramInt) {
        this.i = new LinearLayout(this.c);
        this.i.setOrientation(1);
        int k = s.b(this.c, 12.0F);
        LinearLayout.LayoutParams localLayoutParams = b(-1, -2);
        localLayoutParams.bottomMargin = k;
        this.f = new PayImgTextView(this.c);
        this.f.a(65282);
        this.f.setLayoutParams(localLayoutParams);
        this.f.setTextColor(-10066330);
        this.f.setTextSize(1, s.a(this.c, 22.0F));
        this.f.setSingleLine();
        this.i.addView(this.f);
        localLayoutParams = b(-1, s.b(this.c, 1.0F));
        localLayoutParams.bottomMargin = k;
        this.g = new View(this.c);
        this.g.setLayoutParams(localLayoutParams);
        this.g.setBackgroundColor(-8010673);
        this.i.addView(this.g);
        localLayoutParams = b(-1, -2);
        localLayoutParams.bottomMargin = k;
        this.h = new PayResponseContent(this.c);
        this.h.setLayoutParams(localLayoutParams);
        this.h.a(paramInt);
        this.i.addView(this.h);
        return this.i;
    }

    protected final boolean b() {
        return true;
    }

    public void a(com.qihoo.gamecenter.sdk.pay.k.a parama) {
        super.a(parama);
        if (this.h == null)
            return;
        this.h.a(parama);
    }

    public void a(int paramInt, String paramString1, String paramString2) {
        switch (paramInt) {
        case 1:
            this.g.setBackgroundColor(-25206);
            this.f.setImageRes(1073741885);
            this.f.setText(" " + paramString1);
            this.h.setContent(paramInt, paramString2);
            this.h.setVisibility(0);
            if (!(b()))
                return;
            this.h.setBackToGame();
            break;
        case 0:
            this.f.setImageRes(1073741888);
            this.f.setText(" " + paramString1);
            this.h.setContent(paramInt, paramString2);
            this.g.setBackgroundColor(-8010673);
            this.h.setVisibility(0);
        }
    }

    private LinearLayout.LayoutParams b(int paramInt1, int paramInt2) {
        return new LinearLayout.LayoutParams(paramInt1, paramInt2);
    }
}